/**
 * Created by 228540196@qq.com on 2017/7/4.
 * index.js-pc
 */

$(function(){
    /*职位条件刷选搜索start*/
    $('.job-nav ul li').click(function () {

        if($(this).hasClass('job-header-active')){
            $('.recommend-content').slideUp(10);
            $('.job-nav ul li').removeClass('job-header-active');
            $(this).removeClass('job-header-active');
            $(this).find('.recommend-content').slideUp(10);
            $(this).parents('.content-top').next().css('display','none');

        }
        else{
            $('.job-nav ul li').removeClass('job-header-active');
            $('.recommend-content').slideUp(10);
            $(this).addClass('job-header-active');
            $(this).find('.recommend-content').slideDown(100);
            $(this).parents('.content-top').next().css('display','block');
        }

        $('.recommend-content>a').click(function(){
            $('.recommend-content>a>i').removeClass('glyphicon glyphicon-ok');
            $(this).find('i').addClass('glyphicon glyphicon-ok');
        });
        /*职位条件刷选搜索end*/
    });
    /*职位条件刷选搜索end*/

    /*底部固定图标切换start*/
    $('.tabs>li').click(function(){
        var text=$(this).text();
        if(text=='职位'){
            $('.tabs>li>a').attr('class','');
            $(this).find('a').toggleClass('position-active');
        }
        else if(text=='朋友圈'){
            $('.tabs>li>a').attr('class','');
            $(this).find('a').toggleClass('friends-active');
        }
        else if(text=='通知'){
            $('.tabs>li>a').attr('class','');
            $(this).find('a').toggleClass('inform-active');
        }
        else{
            $('.tabs>li>a').attr('class','');
            $(this).find('a').toggleClass('personel-active');
        }
    });
    /*底部固定图标切换end*/



    /*职位详情页面start*/


    /*职位详情点击返回职位搜索*/
    $('#back').click(function(){
        history.back();
    });

    /*职位详情下拉按钮*/
    $('.job-details-content h6 span').click(function(){
        if($(this).hasClass('glyphicon-chevron-up')){
            $(this).removeClass('glyphicon-chevron-up');
            $(this).addClass('glyphicon-chevron-down');
            $(this).parent().prev().find('li:nth-child(n+3)').slideUp(100);

        }else{
            $(this).addClass('glyphicon-chevron-up');
            $(this).removeClass('glyphicon-chevron-down');
            $(this).parent().prev().find('li:nth-child(n+3)').slideDown(100);
        }
    });

    /*职位详情页面end*/

});